﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using dhSystemBLL.orderData;
using baseSet.importExport;
using dhDataAcess.baseBLL;
using dhSystemBLL.produceBLL;

namespace dhsystem.produceForm.pdrk
{
    public partial class Frmcoloration : Form
    {
        public Frmcoloration()
        {
            InitializeComponent();
        }
        productUnitBLL productunit = new productUnitBLL();
        pdfpjlbBLL pdfpjlb = new pdfpjlbBLL();
        //开始发胚按钮
        private void toolStripstartcoloration_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = MessageBox.Show("是否开始染色！", "提示信息", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    basicSql.getpdfpStatusUpdate(dGridorderDetail.CurrentRow.Cells["recordid"].Value.ToString());
                }
            }
            catch (FormatException ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
        orderDetailBLL orderDetail = new orderDetailBLL();
        //打开窗口时发生的事件
        private void Frmcoloration_Load(object sender, EventArgs e)
        {
            
           bindingSourcepdfpjlb.DataSource  = pdfpjlb.getpdfpjlbAllBybillStatus("已发胚");
           dGridorderDetail.DataSource = bindingSourcepdfpjlb;
           DcolumnSet.colSet(moduleInfo.pdfpjlb, dGridorderDetail);
        }


        //查询按钮
        private void buttonQuery_Click(object sender, EventArgs e)
        {
            try
            {
                bindingSourcepdfpjlb.DataSource = pdfpjlb.getpdfpjlbAllByorderDetailNo("%" + textorderDetailNoQuery.Text + "%");
                dGridorderDetail.DataSource = bindingSourcepdfpjlb;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
        //染色完成确认
        private void toolStripcolorationend_Click(object sender, EventArgs e)
        {
            Frmstartcoloration startcoloration = new Frmstartcoloration("","");
            startcoloration.ShowDialog();
        }
        //刷新按钮
        private void buttupdate_Click(object sender, EventArgs e)
        {
            bindingSourcepdfpjlb.DataSource = pdfpjlb.getpdfpjlbAllBybillStatus("已发胚");
            dGridorderDetail.DataSource = bindingSourcepdfpjlb;
            DcolumnSet.colSet(moduleInfo.pdfpjlb, dGridorderDetail);
        }

        private void toolExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
